package com.shike.core.exception;

import com.shike.core.utils.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


@ControllerAdvice
public class WebControllerException {
    /**
     * 全局异常捕捉处理
     *
     * @param ex
     * @return
     */
    @ResponseBody
    @ExceptionHandler(value = NotLoginException.class)
    public R errorHandler(Exception ex) {
        return R.NOT_LOGIN_ERROR;
    }
}
